/**
 * 组件全局注册
 * 在main.js中导入并使用
 */

// 导入通用组件
import ObLoading from './ob-loading/ob-loading.vue'
import ObEmpty from './ob-empty/ob-empty.vue'
import ObNavbar from './ob-navbar/ob-navbar.vue'
import ObProductCard from './ob-product-card/ob-product-card.vue'

// 组件列表
const components = [
  ObLoading,
  ObEmpty,
  ObNavbar,
  ObProductCard
]

// 安装函数
const install = (app) => {
  components.forEach(component => {
    app.component(component.name || component.__name, component)
  })
}

export default {
  install
}

// 单独导出组件
export {
  ObLoading,
  ObEmpty,
  ObNavbar,
  ObProductCard
}